﻿// -----------------------------------------------------------------------
// <copyright file="ImagePngExtensions.cs">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

// ReSharper disable CheckNamespace
namespace PortableImagingLibrary
// ReSharper restore CheckNamespace
{
    using System.IO;
    using System.Threading.Tasks;
    using PortableImagingLibrary.Png;

    public static class ImagePngExtensions
    {
        public static Task LoadPngAsync(this Image image, Stream source)
        {
            var imageReader = new PngReader();
            return imageReader.LoadAsync(image, source, new PngLoadOptions());
        }

        public static Task SavePngAsync(this Image image, Stream target, PngSaveOptions options)
        {
            var imageWriter = new PngWriter();
            return imageWriter.SaveAsync(image, target, options);
        }
    }
}
